package org.uni_hi.muus.server.util;

import java.util.Enumeration;
import java.util.Hashtable;

import org.uni_hi.muus.util.IHashtable;

public abstract class DataContainer implements IHashtable{
	
	private Hashtable _hashTable=null;
	
	protected final String _splitToken;
	
	protected final String _valueToken;

	public DataContainer(DataContainer dc){
		_hashTable=dc._hashTable;
		_splitToken=dc._splitToken;
		_valueToken=dc._valueToken;
	}
	
	public DataContainer(String splitToken, String valueToken) {
		_hashTable=new Hashtable(32);
		this._splitToken=splitToken;
		this._valueToken=valueToken;
	}
	
	
	public Object addValuePair(String key, String val){
		return _hashTable.put(key.toLowerCase(), val);
	}

	public void clear() {
		_hashTable.clear();
	}

	public boolean contains(Object value) {
		return _hashTable.contains(value);
	}

	public boolean containsKey(Object key) {
		return _hashTable.containsKey(key);
	}

	public Enumeration elements() {
		return _hashTable.elements();
	}

	public Object get(Object key) {
		return _hashTable.get(key);
	}

	public boolean isEmpty() {
		return _hashTable.isEmpty();
	}

	public Enumeration keys() {
		return _hashTable.keys();
	}

	public Object put(Object key, Object value) {
		return _hashTable.put(key, value);
	}

	public Object remove(Object key) {
		return _hashTable.remove(key);
	}

	public int size() {
		return _hashTable.size();
	}
	
	public String toString(){
		return _hashTable.toString();
	}
}
